package com.example.xihuashoujiduan.activity

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import com.example.xihuashoujiduan.R
import com.example.xihuashoujiduan.base.BaseActivity
import com.example.xihuashoujiduan.databinding.ActivityTixianBinding
import com.example.xihuashoujiduan.fragment.ZhifufangshierFragment
import com.example.xihuashoujiduan.fragment.ZhifufangshisanFragment
import com.example.xihuashoujiduan.fragment.ZhifufangshiyiFragment
import com.example.xihuashoujiduan.viewmodel.Mainviewmodel
import com.example.xihuashoujiduan.window.Chicun

class TixianActivity :BaseActivity<Mainviewmodel, ActivityTixianBinding>(R.layout.activity_tixian){
   val chicun=Chicun()
    val titlelist= mutableListOf<String>("提现到银行卡","提现到支付宝","提现到微信")
    val listfragment= mutableListOf<Fragment>(ZhifufangshiyiFragment(), ZhifufangshierFragment(), ZhifufangshisanFragment()
    )

    override fun initView() {
        chicun.chicun(binding.bu1,0,70)
        chicun.chicun(binding.bu2,0,70)
        chicun.chicun(binding.bu3,0,70)
        chicun.chicun(binding.bu4,0,70)
        chicun.chicun(binding.bu5,0,70)
        chicun.chicun(binding.bu6,0,70)

        chicun.chicunwai(binding.bu1,0,0,15,0)
        chicun.chicunwai(binding.bu2,0,0,15,0)
        chicun.chicunwai(binding.bu4,-380,85,15,0)
        chicun.chicunwai(binding.bu5,0,85,15,0)
        chicun.chicunwai(binding.bu6,0,85,0,0)
        binding.viewpage.adapter=object : FragmentPagerAdapter(supportFragmentManager){
            override fun getCount(): Int {
                return listfragment.size
            }

            override fun getItem(position: Int): Fragment {
                return listfragment[position]
            }

            override fun getPageTitle(position: Int): CharSequence {
                return titlelist[position]
            }


        }
        binding.tabs.setupWithViewPager(binding.viewpage)




    }

    override fun dataObservese() {

    }
}